package com.zhentao.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 阿里云服务配置类
 * 用于管理阿里云相关服务的配置信息
 * 
 * @author zhentao
 * @version 1.0
 * @since 2025-08-27
 */
@Configuration
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "aliyun")
public class AliyunConfig {
    
    /**
     * OCR服务配置
     */
    private Ocr ocr = new Ocr();
    
    public Ocr getOcr() {
        return ocr;
    }
    
    public void setOcr(Ocr ocr) {
        this.ocr = ocr;
    }
    
    /**
     * OCR服务配置内部类
     */
    public static class Ocr {
        /**
         * OCR服务的endpoint地址
         */
        private String endpoint = "ocr-api.cn-hangzhou.aliyuncs.com";
        
        /**
         * 访问密钥ID
         * 建议通过环境变量或配置中心设置
         */
        private String accessKeyId;
        
        /**
         * 访问密钥Secret
         * 建议通过环境变量或配置中心设置
         */
        private String accessKeySecret;
        
        /**
         * 服务区域
         */
        private String region = "cn-hangzhou";
        
        /**
         * 连接超时时间（毫秒）
         */
        private Integer connectTimeout = 10000;
        
        /**
         * 读取超时时间（毫秒）
         */
        private Integer readTimeout = 30000;
        
        public String getEndpoint() {
            return endpoint;
        }
        
        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }
        
        public String getAccessKeyId() {
            return accessKeyId;
        }
        
        public void setAccessKeyId(String accessKeyId) {
            this.accessKeyId = accessKeyId;
        }
        
        public String getAccessKeySecret() {
            return accessKeySecret;
        }
        
        public void setAccessKeySecret(String accessKeySecret) {
            this.accessKeySecret = accessKeySecret;
        }
        
        public String getRegion() {
            return region;
        }
        
        public void setRegion(String region) {
            this.region = region;
        }
        
        public Integer getConnectTimeout() {
            return connectTimeout;
        }
        
        public void setConnectTimeout(Integer connectTimeout) {
            this.connectTimeout = connectTimeout;
        }
        
        public Integer getReadTimeout() {
            return readTimeout;
        }
        
        public void setReadTimeout(Integer readTimeout) {
            this.readTimeout = readTimeout;
        }
    }
}